<!DOCTYPE HTML>
<html>
<head>
    {include file='common_header'}
    <title>管理员列表</title>
    <link href="__AJS__layui/css/layui.css"rel="stylesheet">
</head>
<body>
<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i> 首页
    <span class="c-gray en">&gt;</span> 商品管理 <span class="c-gray en">&gt;</span> 商品列表
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" >
        <i class="Hui-iconfont">&#xe68f;</i>
    </a>
</nav>
<div class="page-container">
    <div class="cl pd-5 bg-1 bk-gray">
        <span class="l">
                <a href="javascript:;" onclick="layer_show('添加商品','{:url('goodsadd')}','','')" class=" btn btn-primary radius">
                     <i class="Hui-iconfont">&#xe604;</i> 添加商品
                </a>
        <!--<a href="?del=1" class="btn btn-warning radius"><i class="Hui-iconfont">&#xe6e2;</i>  回收站</a>-->
        </span>
        <div style="float: right">
            <input type="text" class="input-text" style="width:250px" placeholder="输入商品名" id="keywords" value="{$Think.get.keyword}">
            <button type="button" class="btn btn-success" onclick="reload($('#keywords').val())"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
        </div>
        <table class="table table-border table-bordered table-bg">
            <thead>
            <tr>
                <th scope="col" colspan="15"></th>
            </tr>
            <tr class="text-c">
                <th width="25"><input type="checkbox" name="" value=""></th>
                <th width="40">商品ID</th>
                <th width="90">商品所属店铺</th>
                <th width="80">商品所属分类</th>
                <th width="90">商品名称</th>
                <th width="90">商品原价</th>
                <th width="90">商品优惠价</th>
                <th width="90">商品库存</th>
                <th width="90">商品销量</th>
                <th width="90">是否推荐</th>
                <th width="90">商品图片</th>
                <th width="130">录入时间</th>
                <th width="80">商品状态</th>
                <th width="130">操作</th>
            </tr>
            </thead>
            <tbody>
            {volist name="$list" id="v"}
            <tr class="text-c">
                <td><input type="checkbox" value="{$v['id']}" name="" class="item"></td>
                <td>{$v['id']}</td>
                <td>{$v['shop_name']}</td >
                <td>{$v['classify_name']}</td>
                <td>{$v['goods_name']}</td>
                <td>{$v['goods_price']}</td>
                <td>{$v['goods_discount']}</td>
                <td>{$v['goods_num']}</td>
                <td>{$v['sale_num']}</td>
                <td  onclick="isshow('{:url('isshow',array('id'=>$v['id'],'is_show'=>$v[\'is_show\']))}',{$v['is_show']})">
                    {if condition="$v['is_show'] eq 1"}
                    <span class="btn btn-success radius">是</span>
                    {else /}
                    <span class="btn btn-danger radius" >否</span>
                    {/if}
                </td>
                <td style="height: 50px"><img src="__UPLOADS__{$v['goods_image']}" alt="" width="50" height="50"></td>
                <td>{$v['goods_addtime']|date="Y-m-d H:i:s",###}</td>
                <td  onclick="operation('{:url('operation',array('id'=>$v['id'],'goods_status'=>$v[\'goods_status\']))}',{$v['goods_status']})">
                    {if condition="$v['goods_status'] eq 1"}
                    <span class="	btn btn-success radius" >上架</span>
                    {else /}
                    <span class="btn btn-danger radius" >下架</span>
                    {/if}
                </td>
                <td class="td-manage">
                    <a title="查看" href="javascript:;" onclick="layer_show('商品详情','{:url(\'goods/details\',array(\'id\'=>$v['id']))}','','')" class=" btn btn-primary radius" style="text-decoration:none">
                        <i class="Hui-iconfont">&#xe695;</i>
                    </a>
                    <a title="编辑" href="javascript:;" onclick="layer_show('商品编辑','{:url('showEdit',array('id'=>$v['id']))}','','')" class="btn btn-warning  radius" style="text-decoration:none">
                        <i class="Hui-iconfont">&#xe6df;</i>
                    </a>
                    <!--<a title="上下架操作"  href="javascript:;"  class="btn btn-danger radius" >-->
                        <!--{if condition="$v['goods_status'] eq 1"}-->
                        <!--<i class="Hui-iconfont">&#xe6de;</i>-->
                        <!--{else/}-->
                        <!--<i class="Hui-iconfont">&#xe6dc;</i>-->
                        <!--{/if}-->
                    <!--</a>-->
                </td>
            </tr>
            {/volist}
            </tbody>
        </table>
        <div class="page">
            {$page}
        </div>
    </div>
    <!--_footer 作为公共模版分离出去-->
    {include file='common_footer'}
    <!--/_footer 作为公共模版分离出去-->
</div>
</body>
<script src="__AJS__layui/layui.js"></script>
<script>
    function operation(url,state) {
        var message = state==1?'您确定要下架此商品吗？':'您确定要上架此商品吗？'
        layer.confirm(message, function () {
            requestUrl(url);
        });
    }
    function isshow(url,state) {
        var message = state==1?'您确定不推荐此商品在首页显示吗？':'您确定要推荐此商品在首页显示吗？'
        layer.confirm(message, function () {
            requestUrl(url);
        });
    }
</script>
</html>